import request from '@/utils/myrequest'
// 初始化列表
function getList(kvs) {
  return request({
    url: 'config/Layouts/GetList',
    method: 'get',
    kvs
  })
}
// 新增数据
function addList(kvs) {
  return request({
    url: 'config/Layouts/add',
    method: 'POST',
    kvs
  })
}
// 更新数据
function updateList(kvs) {
  return request({
    url: 'config/Layouts/Update',
    method: 'POST',
    kvs
  })
}
// 查看详情
function detail(kvs) {
  return request({
    url: 'config/Layouts/Get',
    method: 'get',
    kvs
  })
}
// 查看详情
function deleteList(kvs) {
  return request({
    url: 'config/Layouts/Delete',
    method: 'POST',
    kvs
  })
}
// 复制布局
function copyList(kvs) {
  return request({
    url: 'config/Layouts/Copy',
    method: 'POST',
    kvs
  })
}
// 获取布局类型列表
function getLayoutTypeList(kvs) {
  return request({
    url: 'config/Layouts/GetLayoutTypeList',
    method: 'get',
    kvs
  })
}
// 获取活动区域
function getLayoutNameList(kvs) {
  return request({
    url: 'config/Layouts/GetLayoutNameList',
    method: 'get',
    kvs
  })
}
// 获取区域名称
function getEqpAreasList(kvs) {
  return request({
    url: 'config/Layouts/GetEqpAreasList',
    method: 'get',
    kvs
  })
}
// 获取区域机台位置
function getLayoutEqps(kvs) {
  return request({
    url: 'config/LayoutEqps/GetList',
    method: 'get',
    kvs
  })
}
// 保存机台位置
function saveLocation(kvs) {
  return request({
    url: '/config/LayoutEqps/Update',
    method: 'post',
    kvs
  })
}
// 删除操作
function deleteItem(kvs) {
  return request({
    url: '/config/LayoutEqps/Delete',
    method: 'post',
    kvs
  })
}
// 新增获取设备类型列表
export function getEquipmentTypesList(kvs) {
  return request({
    url: '/config/EquipmentTypes/GetIDAndType',
    method: 'get',
    kvs
  })
}

// 新增获取设备类型列表
export function getEqpTypeList(kvs) {
  return request({
    url: '/config/LayoutStructure/GetEqpTypeList',
    method: 'get',
    kvs
  })
}

// 新增设备别名列表
function getByTypeEqpNameList(kvs) {
  return request({
    url: '/config/LayoutEqps/GetEqpNameListByType',
    method: 'get',
    kvs
  })
}
// 确认新增
function newAdd(kvs) {
  return request({
    url: '/config/LayoutEqps/Add',
    method: 'POST',
    kvs
  })
}

function getHandleIdList(kvs) {
  return request({
    url: '/config/EquipmentBase/GetHandleIdList',
    method: 'get',
    kvs
  })
}

export function getLayoutsInfo(kvs) {
  return request({
    url: '/config/Layouts/Get',
    method: 'get',
    kvs
  })
}
export default { getList, addList,
  detail, updateList, deleteList,
  copyList, getLayoutTypeList,
  getLayoutNameList, getEqpAreasList,
  getLayoutEqps, saveLocation, deleteItem,
  getEquipmentTypesList, getByTypeEqpNameList,
  newAdd, getLayoutsInfo, getHandleIdList
}
